/*
 * FileName: BaseService.java
 *
 */
package com.mrc.core.base;

import java.io.Serializable;

import org.apache.log4j.Logger;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author Mrc
 * @version 4.1

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2017-1-19 下午2:22:56          Mrc        4.1         To create
 * </p>
 *
 * @since 
 * @see     
 */
public abstract class BaseService<T extends Serializable> {
    protected static Logger logger = Logger.getLogger(BaseService.class);

    protected abstract BaseDao<T> getDao();

    public void update(T entity) {
        this.getDao().update(entity);
    }

    public void save(T entity) {
        this.getDao().save(entity);
    }

    public void delete(T t) {
        this.getDao().delete(t);
    }

    public T get(Serializable id) {
        return this.getDao().findById(id);
    }

}
